﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace 静态成员变量
{
    class Program
    {
        static void Main(string[] args)
        {
            Person.TotalCount = 30;
            Console.WriteLine(Person.TotalCount);
            DoIt();
            Person.人口汇报();
        }

        static void DoIt()
        {
            Console.WriteLine("sasas");
            Console.WriteLine("引用全局变量{0}:", Person.TotalCount);
        }
    }

    class Person
    {
        public static int TotalCount;

        public int Age
        {
            get;
            set;
        }

        public static void 人口汇报()
        {
            Console.WriteLine("总人口:{0}",TotalCount);
        }
    }
}
